package com.dbsop.domain.transport.agg;

import com.dbsop.domain.transport.AggTransportOperation;
import org.elasticsearch.search.aggregations.AggregationBuilder;
import org.elasticsearch.search.aggregations.AggregationBuilders;

/**
 * 统计
 */
public class TransportCount extends TransportAgg implements AggTransportOperation {
    public TransportCount(String fieldName) {
        super(fieldName);
    }

    public TransportCount(String fieldName, String formatName) {
        super(fieldName, formatName);
    }

    @Override
    public AggregationBuilder aggregationBuilder() {
        return AggregationBuilders.count(formatName).field(fieldName);
    }
}
